home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4588 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: (void(far *)()) 0
  5. Date: 5 Feb 1996 18:11:44 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4f66c0$cn0@solutions.solon.com>
  8. References: <341998718.10858110@magnet.at> <31165B9D.398E@imsisoft.com>
  9. NNTP-Posting-Host: solutions.solon.com
  10.  
  11. In article <31165B9D.398E@imsisoft.com>,
  12. Victor Bazarov  <vbazarov@imsisoft.com> wrote:
  13. >> .... = (void(far *)()) 0;
  14.  
  15. >> Now I want to know if my assumption is right and
  16. >> in case it is, what does this mean for 0 ?
  17.  
  18. >Nothing but what you've said -- cast. '0' has type 'int',
  19. >and must be converted into pointer to function in order
  20. >to be properly assigned.
  21.  
  22. Not exactly.
  23.  
  24. 0 is a special case.  Zero cast to a pointer type is a null pointer of that
  25. type.  Or rather, *a constant zero* is.  An integer with value zero may
  26. produce different results.
  27.  
  28. A textual zero, cast to pointer type, points at no object; this is magic.
  29.  
  30. Before you try to correct or clarify this, *make sure you have read the
  31. C FAQ and understand the relevant points.*
  32.  
  33. -s
  34. -- 
  35. Peter Seebach - seebs@solon.com - Copyright 1995 Peter Seebach.
  36. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  37. Using trn?  Weird new newsgroup problem?  I know the fix!  Email me!
  38. The *other* C FAQ - ftp taniemarie.solon.com /pub/c/afq - Not A Flying Toy
  39.